package org.nudt.common.model

data class ResponseData<T>(
    var code: Int,
    var msg: String,
    val data: T
) {
    companion object {
        fun <T> success(data: T): ResponseData<T> {
            return ResponseData(200, "success", data)
        }
        
        fun <T> error(code: Int, msg: String = "token error", data: T): ResponseData<T> {
            return ResponseData(code, msg, data)
        }
    }
}